package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Region;
import org.apache.ibatis.annotations.Param;

import javax.swing.plaf.nimbus.State;
import java.util.List;

public interface RegionMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Region region);

    Region selectByPrimaryKey(Long id);

    /**
     * 根据状态查询所有的地区
     * @param state 状态
     * @return
     */
    List<Region> selectAll(@Param("state") Long state);

    int updateByPrimaryKey(Region region);

    /**
     * 根据parentId查询子地区
     * @param parentId
     * @return
     */
    List<Region> selectByParentId(@Param("parentId") Long parentId);
}